<script>
export default {
  name: 'OperateCarbonEmissionDataDetail',
  props: {
    // 请求参数
    requestParams: {
      type: Object,
      default: () => ({})
    },
    // 弹窗数据
    popData: {
      type: Object,
      default: () => ({})
    },
    // 弹窗配置
    popConfig: {
      type: Object,
      default: () => ({})
    },
    // 弹窗取消
    close: {
      type: Boolean,
      default: false
    },
    // 弹窗确认
    confirm: {
      type: Boolean,
      default: false
    }
  },
  watch: {
    popData: {
      async handler(data) {
        if (data.id) {
          this.formData = Object.assign({}, data)
          console.log(this.formData);
        }
      },
      deep: true,
      immediate: true
    },
    confirm() {
      this.$emit('onFinish', 'carbon-emission-data-detail')
    }
  },
  data() {
    return {
      formData: {}
    }
  }
}
</script>

<template>
  <div class="data-detail">
    <el-row>
      <el-col :span="12"><span class="label">所属项目:</span> {{ formData.projectName }}</el-col>
      <el-col :span="12"><span class="label">所属场景: </span>{{ formData.sceneInfoName }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="12"><span class="label">统计产品类型:</span> {{ formData.productTypeName }}</el-col>
      <el-col :span="12"><span class="label">设备编号:</span> {{ formData.deviceCode }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <span class="label">设备名称: </span>{{ formData.deviceName }}
      </el-col>
      <el-col :span="12"><span class="label">读表标识: </span>{{ formData.readMeterTagName }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="12"><span class="label">统计类型: </span>{{ formData.staticsTypeName }}</el-col>
      <el-col :span="12"><span class="label">测算范围: </span>{{ formData.calculationRangeName }}</el-col>
      <el-col :span="12"><span class="label">能源分类: </span>{{ formData.energyCategoryName }}</el-col>
      <el-col :span="12"><span class="label">能源名称: </span>{{ formData.energyTypeName }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="12"><span class="label">计量值:</span> {{ formData.meterValue }}</el-col>
      <el-col :span="12"><span class="label">单位: </span>{{ formData.energyTypeUnit }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="12"><span class="label">碳排放量kgco2）:</span> {{ formData.carbonEmission }}</el-col>
    </el-row>
  </div>
</template>

<style scoped lang="scss">
.data-detail {

  .el-row {
    line-height: 32px;

    .label {
      font-weight: 700;
    }
  }
}
</style>
